<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>LinkAI - 统一AI服务入口</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/bootstrap/5.3.3/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="styles.css" rel="stylesheet">
</head>
<body>
    <div class="container-fluid">
        <div class="row">
            <!-- 侧边栏 -->
            <div class="col-md-3 sidebar">
                <div class="sidebar-header">
                    <h3><i class="fas fa-robot"></i> LinkAI</h3>
                    <p class="text-muted">统一AI服务入口</p>
                </div>
                
                <div class="provider-section">
                    <h6>选择AI提供商</h6>
                    <select id="providerSelect" class="form-select mb-3">
                        <option value="">加载中...</option>
                    </select>
                    
                    <h6>选择模型</h6>
                    <select id="modelSelect" class="form-select mb-3" disabled>
                        <option value="">请先选择提供商</option>
                    </select>
                </div>

                <div class="usage-info">
                    <small class="text-muted">
                        <i class="fas fa-info-circle"></i> 
                        支持文本生成、摘要、翻译等多种AI服务
                    </small>
                </div>
            </div>

            <!-- 主内容区 -->
            <div class="col-md-9 main-content">
                <div class="header">
                    <h2>AI助手</h2>
                </div>

                <!-- 输入区域 -->
                <div class="input-section">
                    <div class="mb-3">
                        <label class="form-label">输入文本</label>
                        <textarea 
                            id="promptInput" 
                            class="form-control" 
                            rows="4" 
                            placeholder="请输入您想要AI处理的内容..."
                        ></textarea>
                    </div>

                    <div class="mb-3">
                        <label class="form-label">或上传文件</label>
                        <input type="file" id="fileInput" class="form-control">
                        <div id="fileInfo" class="mt-2 small text-muted"></div>
                    </div>

                    <button id="generateBtn" class="btn btn-primary" disabled>
                        <i class="fas fa-magic"></i> 生成
                    </button>
                    <button id="clearBtn" class="btn btn-secondary ms-2">
                        <i class="fas fa-trash"></i> 清空
                    </button>
                </div>

                <!-- 结果区域 -->
                <div id="resultSection" class="result-section" style="display: none;">
                    <h5>AI回复</h5>
                    <div class="result-container">
                        <div id="resultContent" class="result-content"></div>
                        <div class="result-actions">
                            <button id="copyBtn" class="btn btn-sm btn-outline-primary">
                                <i class="fas fa-copy"></i> 复制
                            </button>
                        </div>
                    </div>
                </div>

                <!-- 加载状态 -->
                <div id="loadingSpinner" class="text-center mt-4" style="display: none;">
                    <div class="spinner-border text-primary" role="status">
                        <span class="visually-hidden">处理中...</span>
                    </div>
                    <p class="mt-2 text-muted">AI正在思考中...</p>
                </div>
            </div>
        </div>
    </div>

    <script src="https://cdn.bootcdn.net/ajax/libs/bootstrap/5.3.3/js/bootstrap.bundle.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/axios/1.6.7/axios.min.js"></script>
    <script src="app.js"></script>
</body>
</html>
